define [
  'underscore'
  'chaplin'
], (_, Chaplin) ->

  'use strict'

  # Application-specific utilities
  # ------------------------------

  # Delegate to Chaplin’s utils module
  utils = Chaplin.utils.beget Chaplin.utils

  # Add additional application-specific properties and methods

  _(utils).extend
    upcase: (str) ->
      str.charAt(0).toUpperCase() + str.substring(1)

    isNumber: (val) -> !_.isNaN parseInt val

    toFixed: (val, qtd=2) ->
      val = parseFloat val
      return 0 if _.isNaN val
      return val.toFixed(qtd).replace('.' , ',')

  utils
